{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <h2>启用两步验证(2FA)</h2>
    <div class="card">
        <div class="card-body">
            <h5 class="card-title">扫描二维码</h5>
            <p>请使用Google Authenticator等验证器应用扫描以下二维码：</p>
            <img src="data:image/png;base64,{{ qr_code }}" alt="2FA QR Code" class="img-fluid mb-3">
            <p>或者手动输入密钥：<code>{{ secret }}</code></p>
            
            <form method="POST">
                <div class="form-group">
                    <label for="otp">输入验证码</label>
                    <input type="text" class="form-control" id="otp" name="otp" required>
                </div>
                <button type="submit" name="confirm" class="btn btn-primary">确认启用</button>
            </form>
        </div>
    </div>
</div>
{% endblock %}
